import os
import pytest
import schedule
import time

from common.emailtest import sendemail


def testsuite():
    pytest.main(["./shargeTestCase/",
             "-sv","--alluredir","./testoutput"])
    os.system("allure generate ./testoutput -o ./testoutput/report --clean")
    sendemail(["linzujun@shargetech.com", "lihuaiyuan@shargetech.com"], "case完成，请查看测试报告")
# schedule.every(1).minutes.do(testsuite)
#
# nub = 0
# while True:
#     schedule.run_pending()
#     time.sleep(1)
#     nub += 1
#     print("第%d执行",nub)

if __name__ == "__main__":
    testsuite()